package org.amphiprion.rfreplayanalyser.parser;

public interface ReplayCallbackHandler {
	/**
	 * Called when the replay info segment have been parsed.
	 * 
	 * @param info
	 *            the replay info object
	 */
	void replayInfo(ReplayInfo info);

	/**
	 * Called when a driver segment have been parsed.
	 * 
	 * @param driver
	 *            the driver object
	 */
	void driver(Driver driver);

	/**
	 * Called when the replay info have been update with start, end and duration
	 * times.
	 * 
	 * @param info
	 */
	void replayInfoUpdated(ReplayInfo info);

	/**
	 * Called when a new location is found for a driver.
	 * 
	 * @param loc
	 *            the location event
	 */
	void driverLocation(DriverLocation loc);

	/**
	 * Called when a driver reach a new checkpoint.
	 * 
	 * @param checkpoint
	 *            the checkpoint object
	 */
	void sectorReached(Checkpoint checkpoint);

	/**
	 * Called when the score change. (best lap or driver places)
	 * 
	 * @param score
	 *            the ranking object
	 */
	void score(Score score);

	/**
	 * Called when an error occurs during the parsing.
	 * 
	 * @param io
	 *            the error
	 */
	void errorOccurs(Throwable io);

	/**
	 * Called when the parsing ends successfully
	 */
	void parsingSucced();

	/**
	 * upgrade progress
	 * 
	 * @param pct
	 * @param message
	 */
	void progress(int pct, String message);

	void stopToDriveEvent(StopToDriveEvent evt);

	void damageEvent(DamageEvent de);

	void pitEvent(PitEvent de);

	void startingLights(StartingLightEvent sl);

}
